#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{

	int N = 0;
	scanf("%d", &N);

	int num = 0;
	int min = 0;
	int max = 0;
	
	int arr[60] = { 0 };
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &arr[i]);
	}

	min = arr[0];
	max = arr[0];
	int count_min = 0;
	int count_max = 0;
	for (int i = 0; i < N; i++)
	{
		if (arr[i] > max)
		{
			max = arr[i];
		}
		else if(arr[i] < min)
		{
			min = arr[i];
		}
	}
	for (int i = 0; i < N; i++)
	{
		if (min == arr[i])
			count_min++;
		if (max == arr[i])
			count_max++;
	}

	printf("min = %-6d count_min = %-6d\n", min, count_min);
	printf("max = %-6d count_max = %-6d\n", max, count_max);

	return 0;
}
